﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wuc_edit_profile_donsman.ascx.cs"
    Inherits="CarLoanSystemWeb.Page.EditProfile.wuc_edit_profile_donsman" %>
<%@ Register Assembly="AjaxValidationSummary" Namespace="AjaxValidationSummary" TagPrefix="cc4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<style type="text/css">
    .style5
    {
        font-size: small;
    }
    .style6
    {
        width: 175px;
        font-size: small;
    }
    .style20
    {
        width: 140px;
        height: 5px;
    }
    .style21
    {
        width: 7px;
        height: 5px;
    }
    .style22
    {
        height: 5px;
    }
    .style23
    {
        width: 140px;
        height: 19px;
    }
    .style24
    {
        width: 7px;
        height: 19px;
    }
    .style25
    {
        height: 19px;
    }
</style>
<script type="text/javascript" language="javascript">
    function ValidateText(i) {
        if (i.value.length > 0) {
            i.value = i.value.replace(/[^\d+.\d*$]+/g, '');
        }
        var pattern = /^\d+.?\d*$/;
        var str = i.value;
        if (str.match(pattern) == null) {
            alert("กรุณากรอกข้อมูลให้ถูกต้อง");
            i.value = "0";
        }
    }
</script>
<div id="box_content">
    <div id="box_content_head">
        <h1>
            ข้อมูลผู้ค้ำประกัน
        </h1>
    </div>
    <div id="box_content_body">
        <table style="height: 197px; width: 779px">
            <tr>
                <td class="style23">
                    <span class="style5">ชื่อ</span>
                </td>
                <td class="style24">
                    :
                </td>
                <td class="style25">
                    <asp:TextBox ID="txtName" runat="server" MaxLength="100" Width="200px" Style="margin-left: 0px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="กรุณาระบุชื่อ"
                        CssClass="validation" ValidationGroup="valOfficer" ControlToValidate="txtName">*</asp:RequiredFieldValidator>
                </td>
                <td class="style20">
                    <span class="style6">นามสกุล</span>
                </td>
                <td class="style21">
                    :
                </td>
                <td class="style22">
                    <asp:TextBox ID="txtLastName" runat="server" MaxLength="100" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="กรุณาระบุนามสกุล"
                        CssClass="validation" ValidationGroup="valOfficer" ControlToValidate="txtLastName">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style23">
                    <span class="style5">เลขที่บัตรประจำตัวประชาชน</span>
                </td>
                <td class="style24">
                    :
                </td>
                <td class="style25">
                    <asp:TextBox ID="txtPerId" runat="server" MaxLength="13" Width="200px" Style="margin-left: 0px"
                        onkeyup="ValidateText(this);"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="กรุณาระบุเลขที่บัตรประจำตัวประชาชน"
                        CssClass="validation" ValidationGroup="valOfficer" ControlToValidate="txtPerId">*</asp:RequiredFieldValidator>
                </td>
                <td class="style20">
                    <span class="style6">อายุ</span>
                </td>
                <td class="style21">
                    :
                </td>
                <td class="style22">
                    <table>
                        <tr>
                            <td>
                                <asp:TextBox ID="txtAge" runat="server" MaxLength="2" Width="100px" onkeyup="ValidateText(this);"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="กรุณาระบุอายุ"
                                    CssClass="validation" ValidationGroup="valOfficer" ControlToValidate="txtAge">*</asp:RequiredFieldValidator>
                            </td>
                            <td>
                                <span class="style6">ปี</span>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="style23">
                    <span class="style5">เบอร์โทรศัพท์</span>
                </td>
                <td class="style24">
                    :
                </td>
                <td class="style25">
                    <asp:TextBox ID="txtTel" runat="server" MaxLength="10" Width="200px" 
                        Style="margin-left: 0px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="กรุณาระบุเบอร์โทรศัพท์"
                        CssClass="validation" ValidationGroup="valOfficer" ControlToValidate="txtTel">*</asp:RequiredFieldValidator>
                </td>
                <td class="style20">
                    <span class="style6">เบอร์โทรศัพท์ที่ทำงาน</span>
                </td>
                <td class="style21">
                    :
                </td>
                <td class="style22">
                    <asp:TextBox ID="txtTelWork" runat="server" MaxLength="10" Width="200px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="กรุณาระบุเบอร์โทรศัพท์ที่ทำงาน"
                        CssClass="validation" ValidationGroup="valOfficer" ControlToValidate="txtJob">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style23">
                    <span class="style5">อาชีพ</span>
                </td>
                <td class="style24">
                    :
                </td>
                <td class="style25">
                    <asp:TextBox ID="txtJob" runat="server" MaxLength="100" Width="200px" Style="margin-left: 0px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="กรุณาระบุอาชีพ"
                        CssClass="validation" ValidationGroup="valOfficer" ControlToValidate="txtJob">*</asp:RequiredFieldValidator>
                </td>
                <td  class="style20">
                    <span class="style6">
                        <asp:Label ID="lblSararay1" runat="server" Text="เงินเดือน"></asp:Label></span>
                </td>
                <td class="style21">
                    <asp:Label ID="lblSararay2" runat="server" Text=":"></asp:Label>
                </td>
                <td class="style22">
                    <table>
                        <tr>
                            <td>
                                <asp:TextBox ID="txtSalary" runat="server" MaxLength="10" Width="100px" Enabled="False"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="lblSararay3" runat="server" Text="บาท"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="style23">
                    <span class="style5">ที่อยู่</span>
                </td>
                <td class="style24">
                    :
                </td>
                <td class="style25">
                    <asp:TextBox ID="txtAddress" runat="server" MaxLength="100" Width="200px" Style="margin-left: 0px"
                        Height="85px" TextMode="MultiLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="กรุณาระบุที่อยู่"
                        CssClass="validation" ValidationGroup="valOfficer" ControlToValidate="txtAddress">*</asp:RequiredFieldValidator>
                </td>
                <td class="style20">
                    <span class="style6">สถานที่ทำงาน</span>
                </td>
                <td class="style21">
                    :
                </td>
                <td class="style22">
                    <asp:TextBox ID="txtAddressWork" runat="server" MaxLength="100" Width="200px" Style="margin-left: 0px"
                        Height="85px" TextMode="MultiLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="กรุณาระบุสถานที่ทำงาน"
                        CssClass="validation" ValidationGroup="valOfficer" ControlToValidate="txtAddressWork">*</asp:RequiredFieldValidator>
                </td>
            </tr>
        </table>
    </div>
   <div id="box_content_footer">
    </div>
    <div style="margin-left: 10px" align="left">
        <asp:Button ID="btnAddDoc" runat="server" Text="เพิ่มเอกสาร" Style="margin-left: 0px;
            margin-top: 10px;" Width="204px" OnClick="AddDoc_Click" />
    </div>
    <div id="list2" runat="server">
        <asp:GridView ID="gvListDoc" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            PageSize="20" Width="100%" BackColor="#FF99FF" DataKeyNames="BONDSMAN_DOC_ID"
            Style="margin-left: 0px; font-size: small; margin-top: 12px;" OnRowEditing="gvListDoc_EditCommand"
            OnPageIndexChanging="gvListDoc_PageIndexChanging" OnRowDeleting="gvListDoc_RowDeleting">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:CommandField ButtonType="Image" EditImageUrl="~/images/Icon/save-alt.png" HeaderText="ดาวน์โหลด"
                    ShowCancelButton="False" ShowEditButton="True" ItemStyle-Width="12%" />
                <asp:TemplateField HeaderText="ลบ" ShowHeader="False">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" CommandName="Delete"
                            ImageUrl="~/images/Icon/delete.png" Text="ลบ" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:BoundField DataField="BONDSMAN_DOC_ID" HeaderText="รหัสเอกสาร" />
                <asp:BoundField DataField="BONDSMAN_DOC_NAME" HeaderText="ชื่อเอกสาร" />
            </Columns>
            <HeaderStyle BackColor="White" Height="30px" />
            <PagerSettings Mode="NumericFirstLast" />
            <RowStyle HorizontalAlign="Center" Height="20px" />
        </asp:GridView>
    </div>
    <div class="action" style="margin-top: 15px">
        <asp:HyperLink ID="hplBack" runat="server" CssClass="button cancel" NavigateUrl="~/Page/EditProfile/EditProfilePage.aspx">ยกเลิก</asp:HyperLink>
        <asp:LinkButton ID="btnSave" runat="server" ValidationGroup="valOfficer" CssClass="button save"
            OnClick="btnSave_Click">บันทึก</asp:LinkButton>
        <ajaxToolkit:ConfirmButtonExtender ID="btnSave_ConfirmButtonExtender" runat="server"
            ConfirmText="ต้องการจะบันทึกหรือไม่" Enabled="True" TargetControlID="btnSave">
        </ajaxToolkit:ConfirmButtonExtender>
    </div>
</div>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="validation_sum"
    ValidationGroup="valOfficer" ShowMessageBox="True" ShowSummary="False" />
